package code.module.motion
{
	import code.common.assets.AssetsClassName;
	
	import com.bit101.components.List;
	import com.yy.manager.ResourceManager;
	import com.yy.tools.graphics.GT;
	import com.yy.ui.controls.ScaleButton;
	import com.yy.yyui.table.DataGrid;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Sprite;

	/**
	 *表情面板 
	 * @author YY
	 * 
	 */
	public class MotionPanel extends Sprite
	{
		/**向上翻页**/
		public var preBtn:DisplayObject; 
		/**向下翻页**/
		public var nextBtn:DisplayObject;
		/**表情按钮**/
		public var motionBtn:ScaleButton;//表情按钮
		/**表情列表**/
		public var listDG:DataGrid;//表情列表
		/**表情容器**/
		public var motionContainer:Sprite;
		/**预览表情容器**/
		public var preMotionContainer:Sprite;
		public function MotionPanel()
		{
			init();
		}
		
		private function init():void {
			var dobj:DisplayObject;
			motionContainer = new Sprite();
			addChild(motionContainer);
			preMotionContainer = new Sprite();
			dobj = addChild(preMotionContainer);
			dobj.x = 126;
			dobj.y = -50;
			var mc:MovieClip = ResourceManager.getMovieClipByName(AssetsClassName.ExpressionBg);
			motionContainer.addChild(mc);
			preBtn = mc.preBtn;
			MovieClip(preBtn).buttonMode = true;
			nextBtn = mc.nextBtn;
			MovieClip(nextBtn).buttonMode = true;
			listDG = new DataGrid(38,38,0);
			motionContainer.addChild(listDG);
			motionBtn = new ScaleButton(ResourceManager.getDisplayObjectByName(AssetsClassName.ExpressionBtn));
			dobj = addChild(motionBtn);
			dobj.x = 255;
			dobj.y = 48;
		}
		
		/**
		 *显示表情预览 
		 * @param dobj
		 * 
		 */
		public function set preMotion(dobj:DisplayObject):void {
			GT.removeAllChild(preMotionContainer);
			if(dobj) {
				preMotionContainer.addChild(dobj);
			}
		}
	}
}